using System.Net;
using System.Web;
using Microsoft.AspNetCore.Razor.TagHelpers;

namespace ReaWTM.LayuiHelper
{
    [HtmlTargetElement("wt:textarea", Attributes = REQUIRED_ATTR_NAME, TagStructure = TagStructure.NormalOrSelfClosing)]
    public class TextAreaTagHelper : BaseFieldTag
    {
 

        public override void Process(TagHelperContext context, TagHelperOutput output)
        {

            output.TagName = "textarea";
            output.TagMode = TagMode.StartTagAndEndTag;
            output.Attributes.Add("class", "layui-textarea");
            if (DefaultValue != null)
            {
                output.Content.SetContent(WebUtility.HtmlDecode(DefaultValue.ToString()));
            }
            else
            {
                output.Content.SetContent(WebUtility.HtmlDecode(Field?.Model?.ToString()));
            }

            base.Process(context, output);
        }

		protected override void SetRequired(TagHelperOutput output)
		{
			throw new System.NotImplementedException();
		}
	}
}
